var gulp = require('gulp');
var connect = require('gulp-connect');
var proxy = require('http-proxy-middleware');

gulp.task('gulpcors', function() {
    connect.server({
        // root: ['path'],
        port: 8000,
        livereload: true,
        middleware: function(connect, opt) {
            return [
                proxy('/auth',  {
                    target: 'http://m.ddshenbian.com',
                    changeOrigin:true
                }),
                proxy('/login', {
                    target: 'http://m.ddshenbian.com',
                    changeOrigin:true
                }),
                proxy('/invest', {
                    target: 'https://www.ddshenbian.com',
                    changeOrigin:true
                })
            ]
        }

    });
});

gulp.task('default', function() {
  // 将你的默认的任务代码放在这
});